﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmMovementDtl")]
    public class MovementDtl
    {
        public MovementDtl()
        {
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "MovementDtlId", ResourceType = typeof(Resources.MovementDtlResource))]
        public int MovementDtlId { get; set; }

        [ForeignKey("Movement")]
        [DataMember, Display(Name = "MovementId", ResourceType = typeof(Resources.MovementDtlResource))]
        public int? MovementId { get; set; }

        [CustomRequired]
        [ForeignKey("Asset")]
        [DataMember, Display(Name = "AssetId", ResourceType = typeof(Resources.MovementDtlResource))]
        public int AssetId { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "MoveQty", ResourceType = typeof(Resources.MovementDtlResource))]
        public int MoveQty { get; set; }

        [StringLength(2)]
        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public int? CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        public Nullable<DateTime> UpdatedWhen { get; set; }
        
        [DataMember]
        public virtual Movement Movement { get; set; }

        [DataMember]
        public virtual Asset Asset { get; set; }
     }
}
